<template>
    
    <input type="text" placeholder="请输入..." v-model="val">
    <button @click="handleadd">提交</button>
</template>
<script setup>
    import { ref,defineEmits } from "vue"
    let val = ref('')
    let emit = defineEmits(['add'])
    let handleadd = ()=>{
        emit('add',val.value)
    }
</script>
<style scoped>
    input{
        margin: 0  0 0 140px;
    }
    
</style>